package com.starry.module.system.api.tenant;

import com.starry.core.common.constants.ApplicationName;
import com.starry.core.common.domain.R;
import com.starry.feign.constants.RpcConstants;
import com.starry.module.system.api.tenant.domain.vo.SysTenantDtlVo;
import com.starry.module.system.api.tenant.factory.SysTenantApiFactory;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

import static com.starry.module.system.constants.ApiConstants.API_PREFIX;

/**
 * RPC-系统租户服务
 *
 * @author xiaoke
 */
@FeignClient(value = ApplicationName.SYSTEM, contextId = "sysTenantApi", fallbackFactory = SysTenantApiFactory.class)
public interface SysTenantApi {


    String GET_DETAIL = RpcConstants.RPC_API_PREFIX + API_PREFIX + "/sysTenantDetails";

    /**
     * RPC-系统租户详情
     *
     * @param id 主键
     * @return 单条数据
     */
    @Operation(summary = "RPC-系统租户详情")
    @GetMapping(GET_DETAIL)
    R<SysTenantDtlVo> findById(@RequestParam("id") Long id);
}
